Skip to content

Improve branch and path coverage presentation in HTML report#1141

Draft
sebastianbergmann wants to merge 8 commits into
mainfrom
feature/branch-path-coverage-improvements
Draft

Improve branch and path coverage presentation in HTML report#1141
sebastianbergmann wants to merge 8 commits into
mainfrom
feature/branch-path-coverage-improvements

Conversation

@sebastianbergmann
Copy link
Copy Markdown
Owner

This intends to make the branch and path coverage views in the HTML code coverage report significantly easier to read and act on.

Source view gutter column

All three source views (line, branch, path) now include a narrow gutter column between the line number and the source code.

In the branch view, this column displays the direction indicators described above. In the line and path views, the column is present but hidden to keep the layout consistent across view tabs.

Inline branch direction indicators

The branch coverage source view now shows colored markers in the gutter at decision-point lines (lines where code can take multiple directions, such as if / else expressions). Each marker represents one branch direction: green for covered, red for uncovered.

Coverage badges on method headings

Each method heading in the branch and path structure sections now shows a coverage badge color-coded green, yellow, or red. This provides a quick at-a-glance summary of how well each method's branches or paths are covered, without needing to scan through the full table.

Path rendering no longer refuses to render

Previously, methods with more than 100 code paths showed only a message saying "too many paths to sensibly render." Now the full path table is always rendered. For methods with many paths, the table is wrapped in a collapsible section (collapsed by default) so the page remains navigable while still providing access to all the data.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 14, 2026

Codecov Report

❌ Patch coverage is 96.42857% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.97%. Comparing base (ab8a36c) to head (d6ca908).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Report/Html/ControlFlowGraph.php 95.08% 6 Missing ⚠️
src/Report/Html/Renderer/File.php 97.29% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1141      +/-   ##
============================================
- Coverage     98.04%   97.97%   -0.08%     
- Complexity     1622     1677      +55     
============================================
  Files           114      115       +1     
  Lines          5429     5632     +203     
============================================
+ Hits           5323     5518     +195     
- Misses          106      114       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch from 7d46249 to 50f1729 Compare March 14, 2026 09:56
@sebastianbergmann
Copy link
Copy Markdown
Owner Author

Both #1140 and this have the same ancestor, but #1140 is the bigger change and should be merged first, in case both #1140 and this will be merged.

@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch from 50f1729 to 911a937 Compare March 17, 2026 09:42
@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch 2 times, most recently from 4107924 to 59f5c88 Compare March 25, 2026 08:15
@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch from 59f5c88 to 6a2617f Compare March 31, 2026 14:16
@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch 2 times, most recently from a557754 to a6ab506 Compare April 20, 2026 08:54
@sebastianbergmann sebastianbergmann force-pushed the feature/branch-path-coverage-improvements branch from a6ab506 to d6ca908 Compare June 5, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant